@extends('layouts.teacher')

@section('title', '班级列表')

@section('content')
<div class="panel panel-primary">
    <div class="panel-heading">
        <h2 class="panel-title">班级列表</h2>
    </div>
    <div class="panel-body">
        @if(count($clazzes) > 0)
        <div class="table-responsive">
            <table class="table table-striped table-hover">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>班级名称</th>
                        <th>班级人数</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($clazzes as $clazz)
                    <tr>
                        <td>{{ $clazz->id }}</td>
                        <td>{{ $clazz->name }}</td>
                        <td>{{ $clazz->students_count }}</td>
                        <td>
                            <a href="{{ route('teacher.students', ['clazzId' => $clazz->id, 'sort' => 'n', 'filter' => 'c']) }}" 
                               class="btn btn-sm btn-info">课堂评价</a>
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
        @else
        <div class="alert alert-warning">
            暂无班级数据，请先添加班级。
        </div>
        @endif
    </div>
</div>
@endsection
